package com.itfreer.gis.arcgis;

import org.junit.Test;

import com.itfreer.gis.graphic.GisPoint;
import com.itfreer.gis.graphic.GisPolyg;

public class updateFeature {

	@Test
	public void test() {
		String baseUrl="http://192.168.1.120:6080/arcgis/rest/services/TEST/FeatureServer";
		Integer layerId=0;
		GisPolyg polyg=new GisPolyg();
		GisPoint point=new GisPoint();
		point.setX(113.266);
		point.setY(23.369);
		
		GisPoint point1=new GisPoint();
		point1.setX(113.389);
		point1.setY(23.371);
		
		
		GisPoint point2=new GisPoint();
		point2.setX(113.389);
		point2.setY(23.324);
		
		GisPoint point3=new GisPoint();
		point3.setX(113.266);
		point3.setY(23.324);
		
		polyg.addPoint(point);
		polyg.addPoint(point1);
		polyg.addPoint(point2);
		polyg.addPoint(point3);
		
		polyg.getAttribute().put("OBJECTID", 10002);
		polyg.getAttribute().put("OBJECTID_1", 8015);
		polyg.setKeyField("OBJECTID_1");
		polyg.getAttribute().put("SHENG", 44);
		try {
			new ArcgisOption().updateFeature(baseUrl, layerId, polyg);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
